package com.leetcode.BinaryTree;

public class lc_104 {
    public static void main(String[] args) {

    }

    public int maxDepth(TreeNode root) {
        //1.边界条件:
        if (root == null) {
            return 0;
        }
        //2.每一层逻辑
        int left = maxDepth(root.left);
        int right = maxDepth(root.right);
        return Math.max(left, right) + 1;
    }
}
